#ifndef __SCHEDULE_COUNT_DOWN_H__
#define __SCHEDULE_COUNT_DOWN_H__
#include "cocos2d.h"
#include "ScheduleCounterProtocol.h"

class ScheduleCountDown : public cocos2d::CCNode
{
public:
	ScheduleCountDown();
	virtual ~ScheduleCountDown();

	static ScheduleCountDown* create(ScheduleCounterDelegate* target,int perimeter=60,bool loop=true);
	bool init(ScheduleCounterDelegate* target,int perimeter=60,bool loop=true);
	bool getLoop() const { return _loop; }
	void setLoop(bool loop) { _loop=loop; };
private:
	void schedulePerSecond(float delta);
private:
	ScheduleCounterDelegate* _target;
	int _curTime;
	int _maxTime;
	bool _loop;
};

#endif